<div class="pull-left">
  <h4>Licenses</h4>
</div>
<div class="pull-right">
  <%= link_to 'Add new license', new_driver_license_path(@driver), :class => 'btn btn-mini btn-primary' %>
</div>
<table class="table table-bordered">
  <thead>
    <tr>
      <th>License Type</th>
      <th>Name</th>
      <th>License No</th>
      <th>Issued Date</th>
      <th>Valid Through</th>
      <th>Remarks</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <% @driver.licenses.each do |license| %>
    <tr>
      <td> <%= license.license_type.name %> </td>
      <td> <%= license.name %> </td>
      <td> <%= license.license_no %> </td>
      <td> <%= license.issued_date %> </td>
      <td> <%= license.expiry_date %> </td>
      <td> <%= license.remarks %> </td>
      <td> <%= link_to 'Edit', edit_driver_license_path(@driver, license), :class => 'btn btn-mini btn-primary' %>
      <%= link_to 'Remove', driver_license_path(@driver, license), :confirm => 'Are you sure?', :method => :delete, :class => 'btn btn-mini btn-danger' %> </td>
    </tr>
    <% end %>
  </tbody>
</table>
